package com.eonmind.vip.controller;

import com.eonmind.common.contract.data.response.ResponseEntity;
import com.eonmind.common.provider.entity.vip.PointsConsumption;
import com.eonmind.common.provider.entity.vip.VipPackage;
import com.eonmind.common.security.annotations.UserInfo;
import com.eonmind.user.contract.dto.UserInfoData;
import com.eonmind.vip.service.CommodityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 商品相关
 */
@RestController
@RequestMapping("/commodity")
public class CommodityController {

    @Autowired
    private CommodityService commodityService;

    /**
     * 获取所有商品
     * @return ResponseEntity<Integer>
     * @ignoreParams userInfoData
     */
    @GetMapping("/list")
    @UserInfo
    public ResponseEntity<List<VipPackage>> saveConsumption(UserInfoData userInfoData) {
        return ResponseEntity.success(commodityService.getAllCommodity());
    }
}
